/*
 * This is written by Lulu Han.
 * E-mail: locomotive_crypto@163.com
 */

// Secure Multiplication
#ifndef PPSPD_SEC_MUL_H
#define PPSPD_SEC_MUL_H

#include "paillier.h"

class SecMul{
public:
	class CloudA: public Decryptor{
	public:
		CloudA(const PrivateKey& pri);
		
		void dec_reenc(const NTL::ZZ& nca, const NTL::ZZ& ncb, NTL::ZZ& cmul);
	};
	
	
	class CloudB: public Encryptor{
	public:
		CloudB(const PublicKey& pub);
		
		void gen_two_ciphers(const NTL::ZZ& ca, const NTL::ZZ& cb,
			NTL::ZZ& nca, NTL::ZZ& ncb);
		
		void gen_mul(const NTL::ZZ& cmul, NTL::ZZ& cab);
	private:
		NTL::ZZ m_subexp;
	};
};

#endif // PPSPD_SEC_MULT_H
